package com.qingcheng.service.impl;

import com.qingcheng.service.goods.CategoryService;
import com.qingcheng.service.goods.SaveAllToESService;
import com.qingcheng.service.goods.SpuService;
import org.springframework.beans.factory.InitializingBean;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Component;

//运行模块时自动运行的类
@Component
public class Init implements InitializingBean{

    @Autowired
    private CategoryService categoryService;

    @Autowired
    private SpuService spuService;

    @Autowired
    private SaveAllToESService saveAllToESService;

    public void afterPropertiesSet() throws Exception {
        //保存所有的菜单
        System.out.println("Menu hot loading ---------------------->");
        //categoryService.saveCategoryTreeToRedis();

        //保存所有的价格
        System.out.println("price hot loading ------------------>");
        //spuService.saveAllPriceToRedis();


        System.out.println("saveAllToEsImpl----------------------->");
        //saveAllToESService.saveAllToESImpl();

    }
}
